package net.cyl.manager;

import net.cyl.emums.ShortLinkStateEnum;
import net.cyl.model.GroupCodeMappingDO;
import net.cyl.model.ShortLinkDO;

import java.util.Map;


public interface GroupCodeMappingManager {
    /**
     * 根据groupId和mappingId查询
     * @param mappingId
     * @param groupId
     * @param accountNo
     * @return
     */
    GroupCodeMappingDO findByGroupIdAndMappingId(Long mappingId, Long groupId, Long accountNo);
    /**
     * 添加
     * @param groupCodeMappingDO
     * @return
     */
    int add(GroupCodeMappingDO groupCodeMappingDO);
    /**
     * 删除
     * @param shortLinkDO
     * @return
     */
    int del(GroupCodeMappingDO groupCodeMappingDO);
    /**
     * 分页查询
     * @param groupId
     * @param accountNo
     * @param page
     * @param size
     * @return
     */
    Map<String,Object> pageShortLinkByGroupId(Long groupId, Long accountNo,Integer page, Integer size);
    /**
     * 更新状态
     * @param groupId
     * @param accountNo
     * @param shortLinkCode
     * @param shortLinkStateEnum
     * @return
     */
    int updateGroupCodeMappingState(Long groupId, Long accountNo, String shortLinkCode, ShortLinkStateEnum shortLinkStateEnum);

    GroupCodeMappingDO findByCodeAndGroupId(String shortLinkCode, Long groupId, Long accountNo);

    int update(GroupCodeMappingDO groupCodeMappingDO);
}
